package com.li.springbootproject.spring.beaninit;

import com.lidong.toolkit.constant.LogConst;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 3/12/2022 4:11 PM
 */
@Configuration
public class BeanInitMethod {

    private static final Logger logger = LoggerFactory.getLogger(InitMethodBean.class);

    @Bean(initMethod = "initBean")
    @Lazy
    public InitMethodBean initMethodBean() {
        InitMethodBean initMethodBean = new InitMethodBean();
        logger.info(LogConst.LOG_SUCCESS_PREFIX + "实例化 InitMethodBean 信息为：" + initMethodBean);
        return initMethodBean;
    }

}
